From: Brian Wolff Date: Fri, 5 Aug 2016 08:17:48 +0000 (+0000) Subject: Register a default value for the timecorrection preference X-Git-Tag: 1.31.0-rc.0~5801^2 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=ad631f135d460fb8a5c301f5959257041e6252d2;p=lhc%2Fweb%2Fwiklou.git Register a default value for the timecorrection preference Previously it had no default value, which means that certain things did not consider it a real option (e.g. userOptions.php). Additionally, this was causing preferences to get confused into thinking that users who did not set a timezone have really selected offset 00:00, so saving the page could change the user's timezone to UTC even if they did not touch the setting. Change-Id: I875c5ab6472324f9bdfdaa784441fbc381087707 --- diff --git a/includes/Setup.php b/includes/Setup.php index 6c5de90939..22462c0a7f 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -654,6 +654,9 @@ date_default_timezone_set( $wgLocaltimezone ); if ( is_null( $wgLocalTZoffset ) ) { $wgLocalTZoffset = date( 'Z' ) / 60; } +// The part after the System| is ignored, but rest of MW fills it +// out as the local offset. +$wgDefaultUserOptions['timecorrection'] = "System|$wgLocalTZoffset"; if ( !$wgDBerrorLogTZ ) { $wgDBerrorLogTZ = $wgLocaltimezone;